package com.ly.mapper;

import com.ly.po.ExamCoursePO;
import com.ly.po.ExamPO;
import com.ly.pojo.Exam;
import com.ly.query.ExamQuery;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ExamMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Exam record);

    int insertSelective(Exam record);

    Exam selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Exam record);

    int updateByPrimaryKey(Exam record);

    ExamPO selectPOByCourseId(int courseId);

    int updateByCourseCode(Exam exam);

    List<ExamPO> selectPOAll();


    int deleteByCourseCode(String courseCode);

    List<ExamPO> selectPOAllByCourseCodes(List<String> courseCodes);

    Exam selectByCourseCode(String courseCode);

    Exam selectByExamCode(String s);

    int updateByExamCode(Exam exam);

    List<Exam> selectByStatus(int status);

    void updateExamStatusByExpire(Exam exam);

    List<ExamCoursePO> selectAllExams(ExamQuery query);

    long countAllExams(ExamQuery query);

    List<String> selectDistinctColleges();

    List<String> selectDistinctMajors();

    List<String> selectDistinctSemesters();

    ExamPO selectExamsByCourseCode(String courseCode);

    List<ExamPO> selectPOByCourseCodesAndSemester(List<String> courseCodes, String semester);
}